package work.mediway.mdm.core.entity;

import javax.validation.constraints.NotBlank;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 字段信息
 *
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2022/6/17
 */
@ApiModel("column")
@Data
public class Column {
    /**
     * 字段名
     */
    @NotBlank(message = "不能为空")
    @ApiModelProperty(value = "列名", required = true)
    private String columnName;
    /**
     * 字段类型
     */
    @NotBlank(message = "不能为空")
    @ApiModelProperty(value = "列类型", required = true)
    private String columnType;

    /**
     * 列长度(日期类型等不能设置长度
     */
    @ApiModelProperty(value = "列长度(日期类型等不能设置长度)")
    private String columnLength;

    /**
     * 是否主键
     */
    @ApiModelProperty(value = "是否主键", allowableValues = "true,false")
    private Boolean isPrimaryKey;
    /**
     * 是否自增
     */
    @ApiModelProperty(value = "是否自增", allowableValues = "true,false")
    private Boolean isIncrement;
    /**
     * 是否为空
     */
    @ApiModelProperty(value = "是否为空", allowableValues = "true,false")
    private Boolean isNotNull;
    /**
     * 字段注释
     */
    @ApiModelProperty(value = "字段注释")
    private String comment;

    /**
     * 是否有外键
     */
    @ApiModelProperty(value = "是否有外键", hidden = true)
    private Boolean existForeignKey;

    @ApiModelProperty(value = "外键表名")
    private String fkTableName;


}
